package org.sbbs.app.license.dao.hibernate;

import org.sbbs.app.license.dao.ProductInfoDao;
import org.sbbs.app.license.model.ProductInfo;
import org.sbbs.base.dao.hibernate.BaseDAOImpl;
import org.springframework.stereotype.Repository;

@Repository( "productInfoDao" )
public class ProductInfoDaoHibernate
    extends BaseDAOImpl<ProductInfo, String>
    implements ProductInfoDao {

    @Override
    public void updateDisabledFlag( String[] ids, Boolean newflag ) {
        String hql = "update " + this.persistentClass.getSimpleName() + " set disabled = ?"  + " where productId=?";
        for ( int i = 0; i < ids.length; i++ ) {
            this.getHibernateTemplate().bulkUpdate( hql, newflag,ids[i] );
        }
    }

}
